#pragma once
#include <complex>
#include "datastore.h"
#include "WaitBoxHelper.h"
#include "waconsts.h"

class GDSA
{
private:
	unsigned int layout;
	//HWND parent;
	CWnd *parent;
	DataStore *dataStore;
	DSAOutput out[5];

	UINT DoCalc(int region,int start,int end, DSAOutput* dsao);
	//std::vector<int> getHemiChannels(bool hemi);
	friend UINT DSA_Working_Thread( LPVOID );
	int FindInOut(int ch, int b, int e);

protected:
	WaitBox wb;
public:
	GDSA(CWnd *h, DataStore* d):parent(h),dataStore(d),layout(WA_DSA_LAYOUT_ALL){};
	~GDSA(void);
	bool StartCalc(int region,int start=0,int end=0, int outIndex=0);
	void Draw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	void DrawSingleDSA(Bitmap *bmp,int w,int h, int indexInOut);
	void SetLayout(unsigned int lo){layout=lo;}
};